// 1.导入HTTP模块
const http = require('http')
const url = require('url')

// 2.创建服务对象
const server = http.createServer((request, response) => {
  // 实例化 URL 的内容
  let url = new URL(request.url, 'http://127.0.0.1')
  // 输出路径
  console.log(url.pathname);


  response.end('url new')
})

// 3.监听端口，启动服务
server.listen(9000, () => {
  console.log('服务已经启动...');

})